const express = require('express');
const path = require('path');
const app = express();
const history = require('connect-history-api-fallback');
const { createProxyMiddleware } = require('http-proxy-middleware');

app.use(history({}));
app.use(express.static(path.join(__dirname, 'dist')));
app.use('/api', createProxyMiddleware({
	target: 'http://127.0.0.1:7001',
	changeOrigin: true,
	ws: true,
}));

app.listen(80, () => {
	console.log('app run success');
});